/*
@Coding: utf-8
@Author: yizhigopher
@Time: 2022/10/24 19:45
@Software: IntelliJ IDEA
*/

import java.util.Scanner;

public class MySQLFuncMain {
    public static void main(String[] args) {
        System.out.println("请输入相应的菜单：\n" +
                "1. 添加数据\n" +
                "2. 查询数据\n" +
                "3. 修改数据\n" +
                "4. 删除数据\n");

        int oper;
        String age;
        String id;
        Scanner sc = new Scanner(System.in);
        oper = sc.nextInt();
        Student stu = new Student();
        switch (oper){
            case 1:
                stu.StudentId = sc.next();
                stu.StudentName = sc.next();
                stu.Sage = sc.nextInt();
                stu.Ssex = sc.next();
                stu.DeptId = sc.next();
                stu.SClass = sc.next();
                MySQLFuncTest.addUser(stu);
                break;
            case 2:
                id = sc.next();
                MySQLFuncTest.search(id);
                break;
            case 3:
                stu.StudentId = sc.next();
                stu.StudentName = sc.next();
                stu.Sage = sc.nextInt();
                stu.Ssex = sc.next();
                stu.DeptId = sc.next();
                stu.SClass = sc.next();
                MySQLFuncTest.updateUser(stu);
                break;
            case 4:
                id = sc.next();
                MySQLFuncTest.deleteUser(id);
        }
    }
}
